React = require('react')
{WebView,Text,ScrollView,TouchableOpacity,Image} = require('react-native')

TopNotice = require('antd-mobile/lib/notice-bar')

Dimensions = require('Dimensions')
{ width, height } = Dimensions.get('window')
{View} = require('react-native')

{fetchGetList,fetchRefreshList} = require('../actions/page_planDetail.js')

_ = require('underscore')
moment = require('moment')
backImg = require('../img/back.png')

Page_ckjl_detail = React.createClass
  componentDidMount:->
  render:->
    model = @props.model
    <View style={width:width,height:height,flexDirection:'column'}>
      <View style={{flexDirection:'row',flex:0,height:60,alignItems:'center', justifyContent:'center',backgroundColor:'#0066FF'}}>
        <View style={{flex:1,padding:10}}>
          <TouchableOpacity onPress={=>@props.navigator.pop()}>
            <Image source={backImg}  style={{height:30,width:30,resizeMode:'contain'}}/>
          </TouchableOpacity>
        </View>
        <View style={{flex:3,justifyContent:'center',alignItems:'center'}}>
          <Text style={{fontSize:20,color:'#ffffff'}}>{model.VCVESCNAME}</Text>
        </View>
        <View style={{flex:1,alignItems:'flex-end',padding:10}}>
        </View>
      </View>
      <ScrollView style={{backgroundColor:'#fffff0',paddingTop:10,height:height-80}}>
        <View style={{flexDirection:'column',marginBottom:10}}>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>中文船名</Text>
              <Text style={styles.text}>{model.VCVESCNAME}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>英文船名</Text>
              <Text style={styles.text}>{model.VCVESENAME}</Text>
            </View>
          </View>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>船籍</Text>
              <Text style={styles.text}>{model.VCNATIONNAME}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>船型</Text>
              <Text style={styles.text}>{model.BOATTYPE}</Text>
            </View>
          </View>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>呼号</Text>
              <Text style={styles.text}>{model.CHCALLNO}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>长度</Text>
              <Text style={styles.text}>{model.NMVESLENGTH}</Text>
            </View>
          </View>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>高度</Text>
              <Text style={styles.text}>{model.NMLGHEIGHT}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>宽度</Text>
              <Text style={styles.text}>{model.NMVESWIDTH}</Text>
            </View>
          </View>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>载重吨</Text>
              <Text style={styles.text}>{model.INSUMMERWEIGHTTON}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>船舶总吨</Text>
              <Text style={styles.text}>{model.INVESSELTOTALTON}</Text>
            </View>
          </View>
          <View style={styles.row}>
            <View style={styles.cell}>
              <Text style={styles.text}>船舶净重</Text>
              <Text style={styles.text}>{model.INVESSELNETTON}</Text>
            </View>
            <View style={styles.cell}>
              <Text style={styles.text}>备注</Text>
              <Text style={styles.text}>{model.VCMEMO}</Text>
            </View>
          </View>
        </View>
      </ScrollView>
    </View>


# <WebView html={model.MS} style={{margin:5,height:500}}>
{StyleSheet} = require('react-native')
styles = StyleSheet.create
  row:
    flexDirection:'row'
    borderWidth:1
    borderStyle:'solid'
    borderColor:'#CCCCCC'
    backgroundColor:'#ffffff'
    padding:10
    marginLeft:10
    marginRight:10
  cell:
    flex:1
    flexDirection:'row'
  text:
    flex:1

mapStateToProps = (state)->
  connected:state.appState.connected

{connect} = require('react-redux')
module.exports = connect(mapStateToProps)(Page_ckjl_detail)
